import React, { Component } from 'react'
import Header from "../common/Header"
import {Icon} from "antd"
import {connect} from "react-redux"
import {Link} from "react-router-dom"
class Collect extends Component {
    render() {
        console.log(this.props.collectList)
        return (
            <div className="page-collect">
                <Header title="我的收藏" back={<span onClick = {()=>{this.props.history.go(-1)}}><Icon type="left" /></span>}></Header>
                <div className="content list">
                    {
                        this.props.collectList.map((ite,i)=>{
                            return (
                                <Link to={{pathname:"/detail",state:{ind:i,obj:ite}}} className="item" key={i}>
                                    <img src={ite.img} alt=""/>
                                    <div className="right">
                                        <h2>{ite.title}</h2>
                                        <p className="p1"><span>★5</span>&nbsp;月售：32</p>
                                        <p className="p2"><span>起送￥40 配送 ￥5</span><span>48分钟 3.2千米</span></p>
                                        <div className="p3">
                                            <p>
                                                <span>100-5</span>
                                                <span>200-10</span>
                                                <span>津贴1元</span>
                                                <span>支持自取</span>
                                            </p>
                                            <b><Icon type="down" /></b>
                                        </div>
                                    </div>
                                </Link>
                            )
                        })
                    }
                    <div className="informise">已全部加载完</div>
                </div>
            </div>
        )
    }
}

export default connect(
    (state)=>{
        return {
            collectList:state.collectList
        }
    },
    (dispatch)=>{
        return {
            
        }
    }
)(Collect)

